#!/bin/sh
top[0]=600688
top[1]=600642
top[2]=600663
top[3]=600623
top[4]=600648
top[5]=600618
top[6]=600600
top[7]=600639
top[8]=000009
top[9]=000539
top[10]=000001
top[11]=600695
top[12]=000029
top[13]=600649
top[14]=000011
top[15]=600609
top[16]=600679
top[17]=600650


startYear=1994
file=1_50

	
for month in 01 02 03 04 05 06 07 08 09 10 11 12
do
###

######################
	echo "BEGIN {

}

\$1 ~ /$((startYear+1))${month}/{
	print
}

END {

}" > ${startYear}.awk
######################

i=0
while [ $i -le 17 ]
do
##
	awk -f ${startYear}.awk ${top[i]}.${file}.whole.return >> ${startYear}${month}.temp.return
	i=$((i+1))
##
done

awk -f sumup.awk ${startYear}${month}.temp.return >> ${startYear}.${file}.average.return

###
done



rm ${startYear}.awk
rm *.temp.return

